#!/bin/bash
mydir=`dirname "$0"`
uninstallToolPath="$mydir/UninstallerTool"
installBasePath="${2}"
installSubPath="."
payloadFile="${PACKAGE_PATH}/../../Resources/Payloads/LUTBuddy.FCP.71bcecca.pax.gz"
productName="MagicBulletLutBuddy"
productNumber="117"
installProductStr=`/usr/bin/grep -i "\<${productName}\>" "/tmp/rgs.C867B87B_3A5F_42DF_A83E_089FEDA01D63_${productNumber}"`
if [ ! -z "${installProductStr}" ]; then
    /usr/bin/xattr -d com.apple.quarantine "${payloadFile}"
    /bin/mkdir -p "$2/${installSubPath}"
    pushd "$2/${installSubPath}"
    /bin/pax -rzf "${payloadFile}"
    popd
    "$uninstallToolPath" -a "colorsuite" "Color Suite" -a "colorsuite.lutbuddy" "LUT Buddy" -a "colorsuite.lutbuddy.FinalCutPro" "LUT Buddy for Final Cut Pro" "${installBasePath}/${installSubPath}/LUT Buddy.fxplug"
fi
